<?php
class CordonHelper {

	public function getList($where=null,$s=0,$l=0){
		return Db::get('Ware')->select()->where(array('cordon','>','0'),$where)
				->order('sno ASC')->limit($s,$l)->getAll();
	}

	public function count($where=null){
		return Db::get('Ware')->count()->where(array('cordon','>','0'),$where)->getCol();
	}

	public function set($wareid, $hem){
		return Db::get('Ware')->update(array('cordon'=>$hem))->where(array('id'=>$wareid))->exec();
	}

	/** 取补库报警记录 */
	public function getLessList(){
		return self::getList('cordon>=amount');
	}
	
}
?>
